package org.happycomp.radiog;

import java.io.File;

import org.happycomp.radio.StopDownloadCondition;
import org.happycomp.radiog.core.StopTimeCondition;

import com.google.inject.AbstractModule;
import com.google.inject.Provides;

public class DownloaderRuntimeModule extends AbstractModule {

	@Override
	protected void configure() {
	}
	
	@Provides
	public File stateFolder() {
		File stateDir = new File(Activator.stateDir());
		if (!stateDir.exists()) {
			if (!stateDir.mkdirs()) return null;
		}
		return stateDir;
	}
	
	@Provides
	public StopDownloadCondition createCondition() {
		return new StopTimeCondition();
	}
}
